Setting Facilities Per Row in a Group Grid Control

Rows in a Group Grid control can be assigned different facilities programmatically.

The following example demonstrates how to do this.

To Set Facilities Per Row in a Group Grid Control

  1. Create a new Studio screen.
  2. Add a Group Grid control to the screen. In the (ObjectCode) field, type "gridControl."
  3. Set up ActiveX Properties for the Group Grid control.
  1. On the ActiveX page, set AutoStart to No. This allows the initialization script (below) to be executed first.
  2. Click the (OCXProperties) field. On the Default page, select a Site/Service and UDC to display. On the Columns page, add one or more columns as desired.
  1. Add script to initialize the Group Grid control.
  1. Open the Script Editor and navigate to gridControl EventInitialize event.
  2. Enter the following script to add rows to the grid, where each row represents a facility that contains the UDC previously provided. Replace the facility names with those in your system.
Copy
Add rows representing facilities
Sub gridControl_EventInitialize()
    Dim This : Set This = gridControl
        This.X.RowFacility(1) = "MyFacility1"
        This.X.RowFacility(2) = "MyFacility2"
        This.X.RowFacility(0) = "MyFacility3"
         
        This.X.RowLabelText(1) = "My Facility 1"
        This.X.RowLabelText(2) = "My Facility 2"
        This.X.RowLabelText(0) = "My Facility 3"
         
        This.X.Start
End Sub
  1. Save the screen and switch to Run mode. The grid automatically displays rows for each facility.